<?php

namespace App\Models;

use App\User;
use Illuminate\Database\Eloquent\Model;

class Advertisement extends Model
{
    protected $table = 'advertisement';

    protected $fillable = ['state'];

    protected $casts = [
        'state' => 'boolean'
    ];

    public function bannering()
    {
        return $this->hasOne(FileTransaction::class, 'id', 'banner');
    }

    public function author()
    {
        return $this->hasOne(User::class, 'id', 'author_id');
    }
}
